#include "SemanticNodeBlockJoinGroup.h"

/**
 *  @fn	SemanticNodeBlockJoinGroup::SemanticNodeBlockJoinGroup(const SyntaxTreeNode *joinGroupNodeP
 *  	arent, SemanticNode *parent)
 * 
 *  @brief	Constructor. 
 * 
 *  @author	Nikola Novak
 *  @date	6/26/2009
 * 
 *  @param	joinGroupNodeParent	If non-null, the join group node parent.
 *  @param	parent				If non-null, the parent.
 */
SemanticNodeBlockJoinGroup::SemanticNodeBlockJoinGroup(const SyntaxTreeNode *joinGroupNodeParent, SemanticNode *parent) : SemanticNode(parent), LabeledNode(joinGroupNodeParent->Nodes->GetData(0)) {
	groupExpression = NULL;
}
/**
 *  @fn	void SemanticNodeBlockJoinGroup::SetGroup(SemanticNodeExpression *group)
 * 
 *  @brief	Sets a group. 
 * 
 *  @author	Nikola Novak
 *  @date	6/26/2009
 * 
 *  @param	group	If non-null, the group.
 */
void SemanticNodeBlockJoinGroup::setGroup(SemanticNodeExpression *group) {
	groupExpression = group;
}
/**
 *  @fn	std::string SemanticNodeBlockJoinGroup::toDebugString(int tab)
 * 
 *  @brief	Converts a tab to a debug string. 
 * 
 *  @author	Nikola Novak
 *  @date	6/25/2009
 * 
 *  @param	tab	The tab.
 * 
 *  @return	This object as a std::string.
 */
std::string SemanticNodeBlockJoinGroup::toDebugString(int tab) {
	std::ostringstream res;
	res << getLabelsDebugString() << ": join group" << std::endl << ((SemanticNode *)groupExpression)->toDebugString(tab + 1);
	return res.str();
}
